package com.fdd.api.model;

/**
 * @author timel
 * @date 2023/5/10
 */
public class OpenApiRequest {
    private String bizData;
    private String timestamp;
    private String nonce;
    private String appId;

    public String getBizData() {
        return bizData;
    }

    public void setBizData(String bizData) {
        this.bizData = bizData;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Override
    public String toString() {
        return "OpenApiRequest{" +
                "bizData='" + bizData + '\'' +
                ", timestamp='" + timestamp + '\'' +
                ", nonce='" + nonce + '\'' +
                ", appId='" + appId + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (!(o instanceof OpenApiRequest)){ return false;}

        OpenApiRequest that = (OpenApiRequest) o;

        if (bizData != null ? !bizData.equals(that.bizData) : that.bizData != null) { return false; }
        if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) { return false; }
        if (nonce != null ? !nonce.equals(that.nonce) : that.nonce != null){ return false; }
        return appId != null ? appId.equals(that.appId) : that.appId == null;
    }

    @Override
    public int hashCode() {
        int result = bizData != null ? bizData.hashCode() : 0;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + (nonce != null ? nonce.hashCode() : 0);
        result = 31 * result + (appId != null ? appId.hashCode() : 0);
        return result;
    }
}
